import { createRouter, createWebHistory } from 'vue-router'
const home=()=>import("../views/home/home.vue")

const routes = [
  {
    path:'/',
    //redirect 是重新定向
    redirect:'/home'
    },
    {
    path:'/home',
    component:home
    },
  {
    path: '/shopcar',//购物车
    name: 'shopcar',
    component: () => import('../views/shopcar/shopcar.vue')
  },
  {
    path:"/profile",//我的
    name:"profile",
    component:()=>import("../views/profile/profile.vue")
  },
  {
    path:"/category",//分类
    name:"category",
    component:()=>import("../views/category/category.vue")
  },
  {
    path: '/detail/:iid',//商品详细
    component: "Detail",
    component:()=>import("../views/detail/Detail.vue")
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
})

export default router
